package il.ac.tau.cvws.scrabblesidekick.server.db.connection;
import java.sql.Connection;
import java.sql.SQLException;
import com.mysql.jdbc.jdbc2.optional.MysqlDataSource;

public class MySQLConnection implements IConnectionPool
{
	private MysqlDataSource dataSource;
	
	public MySQLConnection()
	{
		dataSource = new MysqlDataSource();
		dataSource.setUser("root");
		dataSource.setPassword("root");
		dataSource.setServerName("localhost");
		dataSource.setPort(3306);
		dataSource.setDatabaseName("scrabbleninja");
	}	

	@Override
	public synchronized Connection getConnection() throws SQLException
	{
		return dataSource.getConnection();
	}
}
